package com.ybxx.base.service.impl;

import java.util.List;

import com.ybxx.base.dao.HydropowerDao;
import com.ybxx.base.model.Fees;
import com.ybxx.base.model.Hydropower;
import com.ybxx.base.service.HydropowerService;
import com.ybxx.core.command.QueryFilter;
import com.ybxx.core.dao.GenericDao;
import com.ybxx.core.service.impl.BaseServiceImpl;
import com.ybxx.core.web.paging.PagingBean;

public class HydropowerServiceImpl extends BaseServiceImpl<Hydropower>
		implements HydropowerService {
	private HydropowerDao hydropowerDao;
	public HydropowerServiceImpl(HydropowerDao dao) {
		super(dao);
		this.hydropowerDao=dao;
		// TODO Auto-generated constructor stub
	}
	
	public Hydropower queryHydropower(String cid) {
		String hql="from Hydropower f where f.community.cid='"+cid+"'";
		return (Hydropower)hydropowerDao.findUnique(hql, null);
	}
	@Override
	public Hydropower save(Hydropower entity) {
		this.hydropowerDao.excuteSql("delete from tbl_base_hydropower_item where hcode='"+entity.getHcode()+"'");
		return super.save(entity);
	}

}
